package com.ay7.utils;

import java.util.Random;

/**
 * 键生成类
 * Created by wenjul
 * on 18/3/26 0026 20:39
 */
public class KeyUtil {

    /**
     * 生成唯一的主键
     * 格式：时间+随机数
     * @return
     */
    public static synchronized String genUniqueKey(){
        Random random=new Random();
        Integer number= random.nextInt(90000)+10000;
        return System.currentTimeMillis()+String.valueOf(number);
    }
}
